<?php
//
// test HTTP POST submitter, using libcurl
//
include_once "config.php";
include_once "common.php";


$auth =  $_COOKIE[$th_auth];
$username = $_COOKIE[$th_username];

$subject_id = '6985';//debug
//$subject_id = $_POST["subject_id"];
if ($auth && !empty($auth) && $username && !empty($username)){

	$subject = 'http://api.bgm.tv/subject/'.$subject_id.'/ep?source='.$source;
	$post_data = array ( 'auth' => ($auth) );
	$ep = curl_post($subject, $post_data);


	
	$progress_url = 'http://api.bgm.tv/user/'.$username.'/progress?subject_id='.$subject_id.'&source='.$source;
	
	$progress = curl_post($progress_url, $post_data);
	

	returnError($ep);
	returnError($progress);



	
	
	$json = '{"ep":'.$ep.',"progress":'.$progress.'}';
	
	print $json;

}
else{
printError();
}





?>